package com.tangula.web.kashine.repository;





import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.tangula.web.kashine.entity.OrgStudentRefEntity;

@Repository
public interface OrgStudentRefEntityRepository extends JpaRepository<OrgStudentRefEntity, String>{

	boolean existsByOrgIdAndStudentId(String orgId, String studentId);
	
	OrgStudentRefEntity findByOrgIdAndStudentId(String orgId, String studentId);
	

	@Query(nativeQuery=true,value="SELECT COUNT(*) FROM r_org_student r WHERE r.org_id = :orgId")
	int loadOrgStudentCount(@Param("orgId")String orgId);


	

	
}
